package com.shop.user.config;

import com.shop.user.interceptor.UserTokenInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@Slf4j
public class UserCheckToken implements WebMvcConfigurer {


    @Override
    public void addInterceptors(InterceptorRegistry registry){
        log.info("开始注册微信小程序拦截器...");
        registry.addInterceptor(new UserTokenInterceptor()).addPathPatterns("/**").excludePathPatterns("/user/wares/**").excludePathPatterns("/user/login");
    }

}